<?php
require_once ('../lib/config.php');
require_once ('../lib/facebook.php');
require_once ('../lib/friends.php');
require_once ('../lib/friend.php');
require_once ('../lib/test.php');
require_once ('f:\wamp\www\simpletest\autorun.php');
require_once ('../lib/init.php');

class TestTemplate extends UnitTestCase {
    
    function setUp(){
        global $login_button;
        try{
            $me = getOneself();
        }catch(Exception $e){
            print($login_button);
            exit();
        }
    }
    
    //refer to http://www.simpletest.org/en/unit_test_documentation.html
    function testGetFriendPostActivities(){ 

        $friends = getFriends();
                             
        //sample data from var_export
        $data = array ( 'name' => 'friendsPostQuery', 'fql_result_set' =>  array ( 0 =>     array ( 'actor_id' => '612139051',      ), 1 =>     array (      'actor_id' => '509836156',    ),    2 =>     array (      'actor_id' => '100000591117659',    ),    3 =>     array (      'actor_id' => '509836156',    ),    4 =>     array (      'actor_id' => '100001297801606',    ),    5 =>     array (      'actor_id' => '612139051',    ),    6 =>     array (      'actor_id' => '1847145997',    ),    7 =>     array (      'actor_id' => '100000568852321',    ),    8 =>     array (      'actor_id' => '1468604886',    ),    9 =>     array (      'actor_id' => '1452136143',    ),    10 =>     array (      'actor_id' => '612139051',    ),    11 =>     array (      'actor_id' => '100001437546761',    ),    12 =>     array (      'actor_id' => '100000416787478',    ),    13 =>     array (      'actor_id' => '1452136143',    ),    14 =>     array (      'actor_id' => '572356495',    ),    15 =>     array (      'actor_id' => '1356805212',    ),    16 =>     array (      'actor_id' => '645061280',    ),    17 =>     array (      'actor_id' => '1637340897',    ),    18 =>     array (      'actor_id' => '612139051',    ),    19 =>     array (      'actor_id' => '100000526102422',    ),    20 =>     array (      'actor_id' => '100000525262538',    ),    21 =>     array (      'actor_id' => '509836156',    ),    22 =>     array (      'actor_id' => '1452136143',    ),    23 =>     array (      'actor_id' => '1356805212',    ),    24 =>     array (      'actor_id' => '100000560912448',    ),    25 =>     array (      'actor_id' => '1547370475',    ),    26 =>     array (      'actor_id' => '100000525262538',    ),    27 =>     array (      'actor_id' => '534124579',    ),    28 =>     array (      'actor_id' => '100000526102422',    ),    29 =>     array (      'actor_id' => '100000526102422',    ),    30 =>     array (      'actor_id' => '100000568852321',    ),    31 =>     array (      'actor_id' => '1452136143',    ),    32 =>     array (      'actor_id' => '645061280',    ),    33 =>     array (      'actor_id' => '1452136143',    ),    34 =>     array (      'actor_id' => '509836156',    ),    35 =>     array (      'actor_id' => '612139051',    ),    36 =>     array (      'actor_id' => '509836156',    ),    37 =>     array (      'actor_id' => '550118413',    ),  ),);
        
        processFriendsPostsOnMyWall($friends, $data);
        
        $this->assertTrue(is_array($friends));
        $this->assertTrue(count($friends) == 5);
        
        
        var_export($friends);
    }
    
    function testRealData(){
    }
}
?>